package netty.InAndOutBundHandler.client;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToByteEncoder;

/**
 * @ClassName MyLongToByteEncoder
 * @Description TODO
 * @Author director吴
 * @Date 2022/4/21 13:33
 * @Version 1.0
 **/
public class MyLongToByteEncoder extends MessageToByteEncoder<Long> {
    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, Long aLong, ByteBuf byteBuf) throws Exception {


        System.out.println("MyLongToByteEncoder被调用");
        System.out.println("long:"+aLong);
        byteBuf.writeLong(aLong);


    }
}
